/*
 * Task: 
 *   1. define a class Circle which could:
 *     getRadius, setRadius, getArea.
 *   
 *   2. define a function which could calculate the sum of area in an array.
 *
 *   3. define a function which could print each circle's radius and area in
 *   an array.
 */

#include <iostream>
#include "Circle.h"

using namespace std;


double getSumOfArray(Circle circle_array[], int size_of_array)
{
  double sum = 0;

  for(int i = 0; i < size_of_array; i++)
  {
    sum += circle_array[i].getArea();
  }

  return sum;
}

void printCirclesInfo(Circle circle_array[], int size_of_array)
{
  cout << "=============================================" << endl;
  for(int i = 0; i < size_of_array; i++)
  {
    cout << "circle[" << i << "].getRadius() = " << circle_array[i].getRadius() << endl;
    cout << "circle[" << i << "].getArea() = " << circle_array[i].getArea() << endl;
  }

  cout << "-------------------------" << endl;
  cout << "Sum of Area in the array is = " << getSumOfArray(circle_array, size_of_array) << endl;

  cout << "=============================================" << endl;
}


int main()
{
  cout << "getCircleNumber() = " << Circle::getCircleNumber() << endl;

  Circle circle_1;
  cout << "circle_1.getRadius() = " << circle_1.getRadius() << endl;

  Circle circle_array[5] = {Circle(-1), Circle(2), Circle(3), Circle(4), Circle(5)};

  cout << "printCirclesInfo(): " << endl;
  printCirclesInfo(circle_array, 5);

  cout << "getCircleNumber() = " << Circle::getCircleNumber() << endl;

  Circle circle_array_2[5];

  for(int i = 0; i < 5; i++)
  {
    circle_array_2[i].setRadius(i + 1);
  }

  cout << "printCirclesInfo(): " << endl;
  printCirclesInfo(circle_array, 5);

  cout << "getCircleNumber() = " << Circle::getCircleNumber() << endl;

  return 0;
}
